// 购物车页面，
// 抓取元素
const cartInp = document.querySelector('.cart') 
const ulInp = document.querySelector('.cart>ul')

// 拿到存在本地的数据
const title = window.localStorage.getItem('gwctitle')
const src = window.localStorage.getItem('gwcsrc')
const price = window.localStorage.getItem('gwcprice')

console.log(title);
console.log(src);
console.log(price);

// 渲染购物车
getCart()
function getCart (){
  let str = ''

  str += `
          <li>
            <div class="select">
              <input  class="select_item" type="checkbox">
            </div>
            <div class="show">
              <img src="${ src }" alt="">
            </div>
            <div class="title">${ title }</div>
            <div class="price">￥${ price }</div>
            <div class="number">
              <button data-id="" class="sub">-</button>
              <input type="text" value="1">
              <button data-id="" class="add">+</button>
            </div>
            <div class="subPrice">￥100 </div>
            <div class="del">
              <button data-id="" class="delBtn">删除</button>
            </div>
          </li>
       `

  ulInp.innerHTML = str
}